<template>
    <div>
        <div style="margin-top:30px;margin-bottom: 30px">待处理：</div>

        <el-table
                :data="tableData_1"
                border
                style="width: 100%">
            <el-table-column
                    prop="position"
                    label="职位"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="duty"
                    label="岗位职责"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="requirement"
                    label="任职要求"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="work_location"
                    label="工作地点"
                    width="90">
            </el-table-column>
            <el-table-column
                    prop="status"
                    label="状态"
                    width="160">
                <template slot-scope="scope">
                    <el-tag type="success" effect="dark" v-if="scope.row.status==1">已审核</el-tag>
                    <el-tag type="danger" effect="dark" v-else>未审核</el-tag>
                </template>

            </el-table-column>
            <el-table-column
                    prop="status"
                    label="操作"
                    width="240">
                <template slot-scope="scope">
                    <el-button type="primary" @click="open_1(scope.row)">查看详情</el-button>
                </template>
            </el-table-column>
        </el-table>

        <div style="margin-left: 130px;margin-top: 20px">
            <el-pagination
                    backgroundx
                    :page-size="size"
                    :current-change="currentChange_1"
                    layout="total,prev, pager, next,jumper"
                    :total="total_1">
            </el-pagination>
        </div>
        <div style="margin-bottom:30px;margin-top: 100px">已处理：</div>
        <el-table
                :data="tableData_2"
                border
                style="width: 100%">
            <el-table-column
                    prop="position"
                    label="职位"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="duty"
                    label="岗位职责"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="requirement"
                    label="任职要求"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="work_location"
                    label="工作地点"
                    width="90">
            </el-table-column>
            <el-table-column
                    prop="status"
                    label="状态"
                    width="160">
                <template slot-scope="scope">
                    <el-tag type="success" effect="dark" v-if="scope.row.status==1">已审核</el-tag>
                    <el-tag type="danger" effect="dark" v-else>未审核</el-tag>
                </template>

            </el-table-column>
            <el-table-column
                    prop="status"
                    label="操作"
                    width="240">
                <template slot-scope="scope">
                    <el-button type="primary" @click="open_2(scope.row)">查看详情</el-button>
                </template>
            </el-table-column>
        </el-table>
        <el-dialog
            title="销售总监"
            :visible.sync="dialogVisible"
            width="50%"
    >
        <div >
            <span style="font-weight: 800;">招聘类型：{{recruit.work_type}}</span>
            <span style="margin-left: 100px">工作地点：{{recruit.work_location}}</span>
            <span style="margin-left: 100px">学历要求：{{recruit.degree}}</span>
            <div style="margin-top: 30px">招聘人数：{{recruit.num}}</div>
            <div style="margin-top: 30px">
                <div style="width: 4px;display: inline-block;vertical-align:bottom;height: 20px;
background: #2E87FF;
opacity: 1;
"></div>
                <div style="display: inline">

                    岗位职责：
                    <div style="margin-top: 8px">{{recruit.duty}}</div>
                </div>
                <div style="margin-top: 30px">
                    <div style="width: 4px;display: inline-block;   vertical-align:bottom;height: 20px;
background: #2E87FF;
opacity: 1;
"></div>
                    <div style="margin-top: 30px;display: inline">
                        职位要求：
                        <div style="margin-top: 8px">{{recruit.requirement}}</div>
                    </div>
                </div>
            </div>
        </div>
        <span slot="footer" class="dialog-footer">
  </span>
    </el-dialog>
        <div style="margin-left: 130px;margin-top: 20px">
            <el-pagination
                    background
                    :page-size="size"
                    @current-change="currentChange_2"
                    layout="total,prev, pager, next,jumper"
                    :total="total_2">
            </el-pagination>
        </div>

    </div>
</template>

<script>
    export default {
        name: "recruit_review",
        data(){
            return{
                recruit:{},
                innerVisible:false,
                dialogVisible:false,
                total_1:0,
                total_2:0,
                size:5,
                tableData_1: [],
                tableData_2: [],
            }
        },
        methods:{
            currentChange_1(page){
                this.initData_1(page)

            },
            currentChange_2(page){
                this.initData_2(page)

            },
            initData_1(page){
                this.getRequest('/recruit/getrecruit_0?status_id='+0+'&page='+page).then(resp=>{
                    console.log(resp)
                    this.tableData_1=resp.data
                    this.total_1=resp.total
                })},
                initData_2(page){
                this.getRequest('/recruit/getrecruit_0?status_id='+1+'&page='+page).then(resp=>{
                    console.log(resp)
                    this.tableData_2=resp.data
                    this.total_2=resp.total
                })
            },
            //外层dialog
            ChangeTrainStatus_1(){
                this.train.status=1
                console.log(this.train)
                this.putRequest('/recruit/changeStatus',this.train).then(resp=>{
                   this.initData_1(1)
                    this.initData_2(1)
                })
                this.dialogVisible=false;
            },
            open_1(data){
                this.recruit=data
                this.dialogVisible=true;
            },
            open_2(data){
                this.recruit=data
                this.dialogVisible=true;
            },
        },
        mounted() {
            this.initData_1(1);
            this.initData_2(1);
        }
    }
</script>

<style scoped>

</style>
